Skip to content

ci: test on more python versions#926

Merged
KowalskiThomas merged 3 commits intomasterfrom
kowalski/ci-test-on-more-python-versions
Apr 8, 2026
Merged

ci: test on more python versions#926
KowalskiThomas merged 3 commits intomasterfrom
kowalski/ci-test-on-more-python-versions

Conversation

@KowalskiThomas
Copy link
Copy Markdown
Contributor

@KowalskiThomas KowalskiThomas commented Mar 25, 2026

Description of the Change

This updates the GHA configuration to run tests on a wider array of Python versions:

  • Python 2.7 because we still have compatibility with it so it needs to work removed this for now because it's not available for setup-python anymore
  • Python 3.4 because it predates the introduction of type hints and thus gives an important signal about type annotations not being a problem removed this for now because it's not available for setup-python anymore
  • Python 3.7 ... 3.14 because 3.7 was already tested and 3.14 is the latest.

In order for tests to pass on more recent versions of Python, I had to

  • Make sure the API Client supports decoding gzip-compressed API responses (because vcrpy now doesn't decompress transparently)
  • Do not pass mix_stderr on versions of Python more recent than 3.10 because the Click version we get there doesn't have this parameter anymore. I'm not sure what better way to do that there is to be honest...
  • Make a variable out of locals() because since 3.10 locals() returns a new dict at each call, making the previous approach just not work.

I do plan to add support for Python 2.7 and 3.4 back (especially because I think the code currently on master doesn't work with 2.7), but I want to keep this PR reasonably-sized.

Note I tried to add the label to run integration tests (that run against the real Datadog API) but it turns out those apparently have stopped working since they were working (in 2020) because the Datadog API changed. I updated the Python version there as well so that at least they can start.

@KowalskiThomas KowalskiThomas added changelog/no-changelog Changes don't appear in changelog ci/integrations Run integration tests labels Apr 7, 2026
@KowalskiThomas KowalskiThomas force-pushed the kowalski/ci-test-on-more-python-versions branch from 3a6e111 to 028a289 Compare April 7, 2026 13:47
@KowalskiThomas KowalskiThomas marked this pull request as ready for review April 7, 2026 13:51
@KowalskiThomas KowalskiThomas requested review from a team as code owners April 7, 2026 13:51
@KowalskiThomas KowalskiThomas removed the ci/integrations Run integration tests label Apr 7, 2026
Comment thread datadog/api/api_client.py
Comment on lines +186 to +191
if content and result.headers.get("Content-Encoding") == "gzip":
try:
content = zlib.decompress(content, zlib.MAX_WBITS | 16)
except zlib.error:
pass

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@KowalskiThomas KowalskiThomas merged commit 6a9b3a4 into master Apr 8, 2026
18 checks passed
@KowalskiThomas KowalskiThomas deleted the kowalski/ci-test-on-more-python-versions branch April 8, 2026 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/no-changelog Changes don't appear in changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants